package cn.com.cetccst.appstore.database.converter;

import androidx.room.TypeConverter;

import com.google.gson.Gson;

/**
 * 用于数据库非原生类型转换
 */
public class StringArrayConverter {
    @TypeConverter
    public String[] stringToObject(String value) {
        return new Gson().fromJson(value, String[].class);
    }

    @TypeConverter
    public String objectToString(String[] value) {
        return new Gson().toJson(value);
    }
}
